package isssr.bean.boundary;

import isssr.bean.entity.CurrentUser;
import isssr.bean.entity.OrganizationalGoal;
import isssr.bean.entity.User;

import java.io.Serializable;

import javax.annotation.PostConstruct;

import org.primefaces.event.SelectEvent;
import org.primefaces.model.LazyDataModel;

public class OrganizationalGoalTable implements Serializable {

	private CurrentUser currentUser;
	private LazyOrgGoalDataModel dataModel;
	
	private OrganizationalGoal selectedGoal;
	
	public OrganizationalGoalTable()
	{
	}
	 
	 @PostConstruct
	 public void init()
	 {
		this.dataModel = new LazyOrgGoalDataModel(this.currentUser.getUser());
	 }

	public LazyDataModel<OrganizationalGoal> getDataModel() {
		return dataModel;
	}

	public void onRowSelect(SelectEvent event)
	{
		OrganizationalGoal selectedGoal = (OrganizationalGoal) event.getObject();
		this.selectedGoal = selectedGoal;
	}

	public OrganizationalGoal getSelectedGoal() {
		return selectedGoal;
	}

	public void setSelectedUser(OrganizationalGoal selectedGoal) {
		this.selectedGoal = selectedGoal;
	}

	public CurrentUser getCurrentUser() {
		return currentUser;
	}

	public void setCurrentUser(CurrentUser currentUser) {
		this.currentUser = currentUser;
	}
	
}
